home *** CD-ROM | disk | FTP | other *** search
/ Aminet 15 / Aminet 15 - Nov 1996.iso / Aminet / text / hyper / hsc_source.lha / source / ugly / Makefile < prev    next >
Encoding:
Makefile  |  1996-07-11  |  5.9 KB  |  247 lines

  1. #
  2. # Makefile for ugly functions
  3. #
  4. # Copyright (C) 1993,94,95,96  Thomas Aglassinger
  5. #
  6. # This program is free software; you can redistribute it and/or modify
  7. # it under the terms of the GNU General Public License as published by
  8. # the Free Software Foundation; either version 2 of the License, or
  9. # (at your option) any later version.
  10. #
  11. # This program is distributed in the hope that it will be useful,
  12. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14. # GNU General Public License for more details.
  15. #
  16. # You should have received a copy of the GNU General Public License
  17. # along with this program; if not, write to the Free Software
  18. # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  19. #--------------------------------------------------------------------
  20.  
  21. #
  22. # This Makefile works fine with GNU make 3.74
  23. #
  24. # But as it doesn't require any special features besides from
  25. # conditionals (ifdef/ifeq/else/endif), it should also work with 
  26. # other versions of `make'.
  27. #
  28.  
  29. #--------------------------------------------------------------------
  30. # Selection of compiler and environment
  31. #
  32. # if you specify none, a cc-like compiler and a posix-compatible
  33. # environment will be asumed
  34. #
  35.  
  36. #AMIGA_GCC    = 1    # amiga & gcc
  37. AMIGA_SASC    = 1    # amiga & sas/c 6.x
  38. #AMIGA_VBCC     = 1    # amiga & vbcc (experimental)
  39. #POSIX_GCC    = 1    # posix & gcc
  40.  
  41. #--------------------------------------------------------------------
  42. # Selection of compiler mode
  43. #
  44. # if you specify none, an unoptimised version without
  45. # debugging stuff will be created
  46. #
  47.  
  48. #COMPILER_MODE    = opt    # create optimised version
  49. COMPILER_MODE    = dbg    # create debugging version
  50.  
  51. #--------------------------------------------------------------------
  52. # usually, there should be no need to change anything below this line
  53. #--------------------------------------------------------------------
  54.  
  55. #
  56. # description of symbols:
  57. #
  58. # - COMP    compiler call to create an object file (*.o)
  59. # - LINK    compiler call to link a file
  60. # - SYS        defines operating system
  61. #        (supported: AMIGA,UNIX)
  62. # - DEBUG    compiler flags for developer version
  63. # - NORM    compiler flags for non-optimised version
  64. # - OPTIM    compiler flags for optimised version
  65.  
  66. ifdef AMIGA_GCC
  67. #
  68. # gcc AMIGA
  69. #
  70. SYS  = -DAMIGA -Damigados -noixemul
  71. DEBUG= $(SYS) -DDEBUG_UGLY -ggdb -m68000
  72. NORM = $(SYS) 
  73. OPTIM= $(SYS) -O -s
  74. COMP = gcc -Wall -W -ansi -c
  75. LINK = gcc -Wall -W -ansi -o $@
  76.  
  77. else
  78. ifdef POSIX_GCC
  79. #
  80. # gcc UNIX
  81. #
  82. SYS  = -DUNIX
  83. DEBUG= $(SYS) -DDEBUG_UGLY -ggdb
  84. NORM = $(SYS) 
  85. OPTIM= $(SYS) -O -s
  86. COMP = gcc -Wall -W -ansi -c
  87. LINK = gcc -Wall -W -ansi -o $@
  88.  
  89. else
  90. ifdef AMIGA_SASC
  91. #
  92. # sas/c AMIGA
  93. #
  94. SYS  =
  95. opts =  
  96. DEBUG= $(SYS) $(opts) DEBUG=SF DEF=DEBUG_UGLY
  97. NORM = $(SYS) $(opts) DEBUG=LINE
  98. OPTIM= $(SYS) $(opts) IGN=304 IGN=93 OPTIMIZE NOSTKCHK 
  99. LINK = sc LINK 
  100. COMP = sc
  101.  
  102. else
  103. ifdef AMIGA_VBCC
  104. #
  105. # vbcc AMIGA
  106. #
  107. SYS  = -DAMIGA -dontwarn=205
  108. DEBUG= -DDEBUG
  109. NORM = 
  110. OPTIM=
  111. COMP = vc $(SYS) -o $@ -c
  112. LINK = vc $(SYS) -o $@ 
  113.  
  114. else
  115. #
  116. # cc (should work on most Unix-esh systems;
  117. #    but no optimisation is performed)
  118. #
  119. SYS  = -DUNIX
  120. DEBUG= -DDEBUG_UGLY
  121. NORM = 
  122. OPTIM=
  123. COMP = cc $(SYS) -o $@ -c
  124. LINK = cc $(SYS) -o $@
  125.  
  126. endif    # AMIGA_VBCC
  127. endif    # AMIGA_SASC
  128. endif    # POSIX_GCC
  129. endif    # AMIGA_GCC
  130.  
  131. #
  132. # compiler mode 
  133. #
  134. ifeq ($(strip $(COMPILER_MODE)),opt)
  135. mode = $(OPTIM)
  136. else
  137. ifeq ($(strip $(COMPILER_MODE)),dbg)
  138. mode = $(DEBUG)
  139. else
  140. mode = $(NORM)
  141. endif
  142. endif
  143.  
  144. #--------------------------------------
  145.  
  146. #
  147. # test files
  148. #
  149. all : test_es test_fn test_args test_file test_list test_mem test_str test_time
  150.  
  151. clean :
  152.     delete (#?.o|#?.s|#?.p) quiet
  153.  
  154. ##
  155. ## project
  156. ##
  157.  
  158. #ugly.o: args.o bntree.o dllist.o memory.o prginfo.o string.o umx.o fname.o infile.o ugly.c
  159. #        $(COMP)  ugly.c
  160.  
  161. #ugly_dbg.o: args.o bntree.o dllist.o memory.o prginfo.o string.o umx.o fname.o infile.o ugly.c
  162. #        $(COMP)  ugly.c -DUMEM_TRACKING_DEF -o ugly_dbg.o
  163.  
  164. #header: #?.h
  165. #        copy #?.h sc:include/ugly
  166.  
  167. all_ugly.o :
  168.     $(COMP) all_ugly.c $(mode)
  169.  
  170. ##
  171. ## project files
  172. ##
  173.  
  174. ## not include: types.h
  175.  
  176. args.o: args.h args.c args_hlp.c args_prp.c args_set.c string.h dllist.h
  177.     $(COMP)  args.c $(mode)
  178.  
  179. #bntree.o  : types.h bntree.h bntree.c
  180. #        $(COMP) $(SYS) bntree.c $(mode)
  181.  
  182. dllist.o  : types.h dllist.h dllist.c
  183.     $(COMP) dllist.c $(mode)
  184.  
  185. expstr.o : types.h expstr.c
  186.     $(COMP) expstr.c $(mode)
  187.  
  188. fname.o   : types.h expstr.h string.h fname.h fname.c
  189.     $(COMP) fname.c $(mode)
  190.  
  191. memory.o   : types.h memory.c memory.h dllist.h
  192.     $(COMP) memory.c $(mode)
  193.  
  194. prginfo.o : types.h prginfo.c
  195.     $(COMP) prginfo.c $(mode)
  196.  
  197. string.o  : types.h string.h string.c
  198.     $(COMP) string.c $(mode)
  199.  
  200. time.o  : types.h expstr.h memory.h string.h time.h time.c
  201.     $(COMP) time.c $(mode)
  202.  
  203. #umx.o : types.h umx.h umx.c
  204. #    $(COMP) umx.c $(mode)
  205.  
  206. infile.o : types.h string.h memory.h expstr.h infile.h infile.c
  207.     $(COMP) infile.c $(mode)
  208.  
  209. #outfile.o : types.h string.h memory.h expstr.h outfile.h outfile.c
  210. #    $(COMP) outfile.c $(mode)
  211.  
  212. ##
  213. ## test files
  214. ##
  215.  
  216. test_fn : test_fn.c fname.o memory.o expstr.o
  217.     $(LINK) $(mode) test_fn.c expstr.o fname.o string.o memory.o
  218.  
  219. test_args : test_args.c args.o dllist.o prginfo.o memory.o string.o
  220.     $(LINK) $(mode) test_args.c args.o string.o dllist.o memory.o prginfo.o
  221.  
  222. test_es : test_es.c expstr.o memory.o string.o
  223.     $(LINK) $(mode) test_es.c expstr.o string.o memory.o
  224.  
  225. test_file : test_file.c infile.o dllist.o expstr.o memory.o
  226.     $(LINK) $(mode) test_file.c dllist.o expstr.o infile.o string.o memory.o
  227.  
  228. test_list : test_list.c dllist.o string.o memory.o
  229.     $(LINK) $(mode) test_list.c dllist.o string.o memory.o
  230.  
  231. test_mem : test_mem.c memory.o dllist.o string.o
  232.     $(LINK) $(mode) test_mem.c dllist.o memory.o string.o
  233.  
  234. #test_out : test_out.c outfile.o dllist.o expstr.o memory.o
  235. #    $(LINK) $(mode) test_out.c dllist.o expstr.o outfile.o string.o memory.o
  236.  
  237. test_str : test_str.c memory.o string.o
  238.     $(LINK) $(mode) test_str.c memory.o string.o
  239.  
  240. test_time.o : test_time.c time.o memory.o string.o expstr.o
  241.     $(COMP) test_time.c $(mode)
  242.  
  243. test_time : test_time.o 
  244.     $(LINK) $(mode) test_time.c memory.o string.o expstr.o time.o
  245.  
  246. # EOF
  247.